Repository navigation
[Accuracy diff No. 110, 111] Fix accuracy diff for paddle.nn.functional.binary_cross_entropy, paddle.nn.functional.binary_cross_entropy_with_logits API - #267
Closed
NKNaN wants to merge 4 commits into
Conversation
cangtianhuang
requested changes
Jun 16, 2025
cangtianhuang
left a comment
Collaborator
There was a problem hiding this comment.
如果修改可以全部 pass 的话,请将所有会报 [not compare] 错误的配置,从:tester/api_config/5_accuracy/accuracy_7.txt 移动至 tester/api_config/5_accuracy/accuracy_gpu_error_grads_diff.txt,便于后续复测以及修复~
Contributor
Author
好的 |
Collaborator
|
@NKNaN 以及 tester/api_config/5_accuracy/accuracy_gpu_error.txt 中的所有 [not compare] 出错配置,也复制一份到 tester/api_config/5_accuracy/accuracy_gpu_error_grads_diff.txt 中,保留原有的便于复测 ,辛苦同学 |
Contributor
Author
Collaborator
|
不好意思同学,是我描述有点问题,最终应该这样处理:
|
Contributor
Author
Contributor
Author
|
我 reset 一下 |
Collaborator
好滴,看上去误删了很多,这个应该是 git 索引的问题,文件偏大就会有这个问题😂 |
Contributor
Author
重新提了一个 pr |
Collaborator
|
this pr can be closed safely |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


目前 paddle.nn.functional.binary_cross_entropy, paddle.nn.functional.binary_cross_entropy_with_logits 对应的反向算子只计算 x_grad 不计算 label_grad,而 torch 计算 x_grad 和 target_grad (label_grad):


第一次回测结果:

paddle.nn.functional.binary_cross_entropy_with_logits 能全部通过
paddle.nn.functional.binary_cross_entropy 有两个 case 未通过:
对这两个 case 二次回测结果:
